import 'dart:typed_data';

import 'package:animal/ui/goods/page/shop_mall_page.dart';
import 'package:animal/widgets/navigation_icon_widget.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:get/get.dart';

class HomeIndexController extends GetxController{
  // 初始化导航图标
  var navigationViews = <NavigationIconWidget>[
    NavigationIconWidget(icon: "images/home1.png", activeIcon: "images/home1.png", title: "商城"),
    NavigationIconWidget(icon: "images/home1.png", activeIcon: "images/home1.png", title: "联系人"),
    NavigationIconWidget(icon: "images/home1.png", activeIcon: "images/home1.png", title: "消息"),
    NavigationIconWidget(icon: "images/home1.png", activeIcon: "images/home1.png", title: "购物车"),
    NavigationIconWidget(icon: "images/home1.png", activeIcon: "images/home1.png", title: "我的"),
  ];

  //界面列表
  var pageList = <Widget>[
    ShopMallPage(),
    ShopMallPage(),
    ShopMallPage(),
    ShopMallPage(),
    ShopMallPage(),
  ];
  var currentIndex = 0.obs; // 当前界面的索引值

  //点击时间
  onTap(int index) => currentIndex.value = index;

  @override
  void onInit() {
    super.onInit();
    // tabController = TabController(length: 3, vsync: this);
  }

  Future<ByteData> loadAsset(String musicPath) async {
    return await rootBundle.load(musicPath);
  }
}